package com.xiaochong.tir.trades.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2018/6/16.
 */
@Configurable
@Component
public class OkexQueenConfig {

    @Bean
    public DirectExchange OkexNodeAPIExchange() {
        return new DirectExchange(ExchangeQueue.Exchange.EX_NODE_API_MQ, true, false);
    }
    @Bean
    public Queue queueTradesOkexCnyAction(){
        return new Queue(OkexMqQueue.QUEUE_TRADES_OKEX_CNY, true);
    }
    @Bean
    public Binding bindingTradesOkexCnyAction(){
        return BindingBuilder.bind(queueTradesOkexCnyAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_TRADES_OKEX_CNY);
    }

    @Bean
    public Queue queueTradesOkexUsdAction(){
        return new Queue(OkexMqQueue.QUEUE_TRADES_OKEX_USD, true);
    }
    @Bean
    public Binding bindingTradesOkexUsdAction(){
        return BindingBuilder.bind(queueTradesOkexUsdAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_TRADES_OKEX_USD);
    }

    @Bean
    public Queue queueTradesOkexUsdtAction(){
        return new Queue(OkexMqQueue.QUEUE_TRADES_OKEX_USDT, true);
    }
    @Bean
    public Binding bindingTradesOkexUsdtAction(){
        return BindingBuilder.bind(queueTradesOkexUsdtAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_TRADES_OKEX_USDT);
    }


    @Bean
    public Queue queueTradesOkexOkbAction(){
        return new Queue(OkexMqQueue.QUEUE_TRADES_OKEX_OKB, true);
    }
    @Bean
    public Binding bindingTradesOkexOkbAction(){
        return BindingBuilder.bind(queueTradesOkexOkbAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_TRADES_OKEX_OKB);
    }

    @Bean
    public Queue queueTradesOkexBtcAction(){
        return new Queue(OkexMqQueue.QUEUE_TRADES_OKEX_BTC, true);
    }
    @Bean
    public Binding bindingTradesOkexBtcAction(){
        return BindingBuilder.bind(queueTradesOkexBtcAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_TRADES_OKEX_BTC);
    }

    @Bean
    public Queue queueTradesOkexEthAction(){
        return new Queue(OkexMqQueue.QUEUE_TRADES_OKEX_ETH, true);
    }
    @Bean
    public Binding bindingTradesOkexEthAction(){
        return BindingBuilder.bind(queueTradesOkexEthAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_TRADES_OKEX_ETH);
    }

    @Bean
    public Queue queueTradesOkexTestbAction(){
        return new Queue(OkexMqQueue.QUEUE_TRADES_OKEX_TESTB, true);
    }
    @Bean
    public Binding bindingTradesOkexTestbAction(){
        return BindingBuilder.bind(queueTradesOkexTestbAction()).to(OkexNodeAPIExchange()).with(OkexMqQueue.QUEUE_TRADES_OKEX_TESTB);
    }
}
